<include file="Public/header"/>
<div class="row">
    <div class="col-md-12">
        <div class="ibox float-e-margins">
            <!--条件查询-->
            <div class="ibox-title">
                <h5>资金变动管理</h5>
                <div class="ibox-tools">
                    <i class="layui-icon" onclick="location.replace(location.href);" title="刷新"
                       style="cursor:pointer;">ဂ</i>
                </div>
            </div>
            <!--条件查询-->
            <div class="ibox-content">
                <form class="layui-form" action="" method="get" autocomplete="off" id="orderform">
                    <input type="hidden" name="m" value="<{$model}>">
                    <input type="hidden" name="c" value="Order">
                    <input type="hidden" name="a" value="changeRecord">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="memberid" autocomplete="off" placeholder="请输入商户号"
                                       class="layui-input" value="<{$_GET['memberid']}>">
                            </div>

                            <div class="layui-input-inline">
                                <input type="text" name="orderid" autocomplete="off" placeholder="请输入订单号"
                                       class="layui-input" value="<{$_GET['orderid']}>">
                            </div>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="createtime" id="createtime"
                                       placeholder="起始时间" value="<{$_GET['createtime']|urldecode}>">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="tongdao">
                                    <option value="">全部通道</option>
                                    <volist name="banklist" id="vo">
                                        <option <if condition="$_GET[tongdao] eq $vo[code]">selected</if>
                                        value="<{$vo.code}>"><{$vo.name}></option>
                                    </volist>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="bank">
                                    <option value="">全部类型</option>
                                    <option <if condition="$_GET[bank] eq 1">selected</if> value="1">付款</option>
                                    <option <if condition="$_GET[bank] eq 3">selected</if> value="3">手动增加</option>
                                    <option <if condition="$_GET[bank] eq 4">selected</if> value="4">手动减少</option>
                                    <option <if condition="$_GET[bank] eq 6">selected</if> value="6">结算</option>
                                    <option <if condition="$_GET[bank] eq 10">selected</if> value="10">委托结算</option>
                                    <option <if condition="$_GET[bank] eq 11">selected</if> value="11">提款驳回</option>
                                    <option <if condition="$_GET[bank] eq 12">selected</if> value="12">代付驳回</option>
                                    <option <if condition="$_GET[bank] eq 7">selected</if> value="7">冻结</option>
                                    <option <if condition="$_GET[bank] eq 8">selected</if> value="8">解冻</option>
                                    <option <if condition="$_GET[bank] eq 9">selected</if> value="9">提成</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <button type="submit" class="layui-btn"><span
                                    class="glyphicon glyphicon-search"></span> 搜索
                            </button>
                            <a href="javascript:;" id="export" class="layui-btn layui-btn-danger"><span class="glyphicon glyphicon-export"></span> 导出数据</a>
                        </div>
                    </div>
                </form>

                <!--交易列表-->
                <table class="layui-table" lay-data="{width:'100%',limit:<{$rows}>,id:'userData'}">
                    <thead>
                    <tr>
                        <th lay-data="{field:'key',width:60}"></th>
                        <th lay-data="{field:'transid', width:240}">订单号</th>
                        <th lay-data="{field:'userid', width:100,style:'color:#060;'}">用户名</th>
                        <th lay-data="{field:'lx', width:90}">类型</th>
                        <th lay-data="{field:'tcuserid', width:100,style:'color:#060;'}">用户名(提成)</th>
                        <th lay-data="{field:'tcdengji', width:90}">提成级别</th>
                        <th lay-data="{field:'money', width:100}">变动金额</th>
                        <th lay-data="{field:'datetime', width:180}">变动时间</th>
                        <th lay-data="{field:'tongdao', width:120}">通道</th>
                        <th lay-data="{field:'contentstr', width:100}">备注</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="list" id="vo">
                        <tr>
                            <td><{$vo.id}></td>
                            <td style="text-align:center;"><{$vo.transid}></td>
                            <td style="text-align:center; color:#090;">
                                <{$vo["userid"]|getParentName=###,1}>
                            </td>
                            <td style="text-align:center;">
                                <switch name="vo.lx">
                                    <case value="1">付款</case>
                                    <case value="3">手动增加</case>
                                    <case value="4">手动减少</case>
                                    <case value="6">结算</case>
                                    <case value="10">委托结算</case>
                                    <case value="11">提款驳回</case>
                                    <case value="12">代付驳回</case>
                                    <case value="7">冻结</case>
                                    <case value="8">解冻</case>
                                    <case value="9">提成</case>
                                    <default />未知
                                </switch>
                            </td>
                            <td style="text-align:center; color:#060">
                                <{$vo["tcuserid"]|getParentName=###,1}>
                            </td>
                            <td style="text-align:center; color:#666"><{$vo.tcdengji}>&nbsp;</td>
                            <td style="text-align:center;">
                                <if condition="$vo.money lt 0">
                                    <span style="color:#F00">
                                <else />
                                    <span style="color:#030">
                                </if>
                                <{$vo.money}>
                                </span>
                            </td>
                            <td style="text-align:center;"><{$vo.datetime}></td>
                            <td style="text-align:center;"><{$vo["tongdao"]|getProduct}></td>
                            <td style="text-align:center;">
                                <if condition="$vo.lx == 1 or $vo.lx == 9">
                                    <{:huoquddlx($vo.transid)}>
                                    <else />
                                    <{$vo['contentstr']}>
                                </if>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
                <!--交易列表-->
                <div class="page"><{$page}> 
                    
                    <form class="layui-form" action="" method="get" id="pageForm" autocomplete="off">                                
                        
                        <select name="rows" style="height: 32px;" id="pageList" lay-ignore >
                            <option value="">显示条数</option>
                            <option <if condition="$_GET[rows] neq '' && $_GET[rows] eq 15">selected</if> value="15">15条</option>
                            <option <if condition="$_GET[rows] eq 30">selected</if> value="30">30条</option>
                            <option <if condition="$_GET[rows] eq 50">selected</if> value="50">50条</option>
                            <option <if condition="$_GET[rows] eq 80">selected</if> value="80">80条</option>
                            <option <if condition="$_GET[rows] eq 100">selected</if> value="100">100条</option>
                        </select>
                       

                    </form>
                
                </div> 
            </div>
        </div>
    </div>
</div>
<include file="Public/footer"/>
<script>
    layui.use(['laydate', 'laypage', 'layer', 'table', 'form'], function() {
        var laydate = layui.laydate //日期
            , laypage = layui.laypage //分页
            ,layer = layui.layer //弹层
            ,form = layui.form //表单
            , table = layui.table; //表格
        //日期时间范围
        laydate.render({
            elem: '#createtime'
            , type: 'datetime'
            ,theme: 'molv'
            , range: '|'
        });
    });
    $('#export').on('click',function(){
        window.location.href
            ="<{:U('Admin/Order/exceldownload',array('memberid'=>$_GET[memberid],'orderid'=>$_GET[orderid],'createtime'=>$_GET[createtime],'tongdao'=>$_GET[tongdao],'bank'=>$_GET[bank]))}>";
    });
    $('#pageList').change(function(){
        $('#pageForm').submit();
    });
</script>
</body>
</html>